<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <% foreach (var item in Model.Posts) { %>
       
       <div class="post_wrapper" id="post_<%=item.ID %>">
        <h1>
            <%= Html.ActionLink(item.Title ?? "Details", "Details", new { id = item.ID })%>
        </h1>
        <p>
            <span class="post_date">
                <%=Model.Localize("Blog.postedOn")%>
                <%= Html.Encode(item.DateCreated)%>
            </span>
           <span class="post_author">
                <%=Model.Localize("Blog.by") %>
                <%=item.UserName%>
           </span>
         
             <%if (Model.User.AllowAddEntries())
               { %>
                 <span>
                     <%= Html.ActionLink(Model.Localize("Blog.edit"), "Edit", new { id = item.ID })%> 
              </span>
                <span>
                    <%using (Html.BeginForm<MiniBlogController>(a => a.Delete(item.ID), FormMethod.Post, new { id = "deletePostForm"}))
                      { %>
                      <%=Html.AntiForgeryToken()%>
                      <input type="submit" value="<%=Model.Localize("Blog.delete")%>" />
                    <%} %>
              </span>
              <% } %>
         
       </p>
       <div class="post_body">
            <%=item.Content%>
       </div>
      </div>
    
    <% } %>
    <%if (Model.User.AllowAddEntries())
      { %>
    <p>
        <%= Html.ActionLink(Model.Localize("Blog.create"), "Create")%>
    </p>
    <%} %>

</asp:Content>

